package pro.jiug.kWord.entity;

import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 *
 * @author Keffett
 * @since 2021-02-19
 */
public class Student implements Serializable {

    private static final long serialVersionUID=1L;

    private Integer id;

    private String name;

    private Integer chinese;

    private Integer math;

    private Integer sum;

    public Student() {
    }

    public Student(String name, Integer chinese, Integer math) {
        this.name = name;
        this.chinese = chinese;
        this.math = math;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getChinese() {
        return chinese;
    }

    public void setChinese(Integer chinese) {
        this.chinese = chinese;
    }

    public Integer getMath() {
        return math;
    }

    public void setMath(Integer math) {
        this.math = math;
    }

    public Integer getSum() {
        chinese=chinese==null?0:chinese;
        math=math==null?0:math;
        return chinese+math;
    }

    public void setSum(Integer sum) {
        this.sum = sum;
    }
}
